<form nz-form [formGroup]="form" (ngSubmit)="submitForm()">
  <input type="text" type="hidden" formControlName="parentKey">
  <input type="text" type="hidden" formControlName="key">
  <nz-form-item>
    <nz-form-label [nzSpan]="7" nzRequired>名称</nz-form-label>
    <nz-form-control [nzSpan]="12" [nzErrorTip]="userErrorTpl">
      <input nz-input formControlName="name" placeholder="名称" maxlength="8" />
      <ng-template #userErrorTpl let-control>
        <ng-container *ngIf="control.hasError('required')">
          请输入名称!
        </ng-container>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="7" nzRequired>数量</nz-form-label>
    <nz-form-control [nzSpan]="12" nzHasFeedback [nzErrorTip]="emailErrorTpl">
      <input nz-input formControlName="num" placeholder="" type="text"  maxlength="8"/>
      <ng-template #emailErrorTpl let-control>
        <ng-container *ngIf="control.hasError('required')">
          请输入数量！
        </ng-container>
      </ng-template>
    </nz-form-control>
  </nz-form-item>
  <nz-form-item>
    <nz-form-label [nzSpan]="7" nzRequired>地址</nz-form-label>
    <nz-form-control [nzSpan]="12" nzErrorTip="最大长度28!">
      <textarea formControlName="address" nz-input rows="2" placeholder="请输入地址"  maxlength="28"></textarea>
    </nz-form-control>
  </nz-form-item>
</form>
